package exercise;

import java.util.Scanner;

public class EX01_Q26 {
     
	//#26
	
	public static void main(String[] args) {
		
		 int num1;
		 int num2;
		
	     num1 = (int) (Math.random()*100 )+1;
	     do {
	     System.out.println( "숫자를 입력해주세요~" );
	     Scanner sc = new Scanner (System.in);	
	     num2 =sc.nextInt();
	     
	     if (num1 > num2) {
				System.out.println( "추측한 숫자가 큽니다" );
			} else if (num1 < num2 ) {
				System.out.println( "추측한 숫자가 작습니다" );			
			} else if (num1 == num2 ) { 
				System.out.println( "빙고! 숫자를 맞췄습니다");
			}
	     } while (num1>num2 || num1<num2);	
	     
	     
	     
	     //teacher풀이
	     int myNum =0;
	     int comNum=0;
	     
	     Scanner sc = new Scanner (System.in);	
	     comNum = (int) (Math.random()*100)+1;
	     while(myNum !=comNum){
	    	 System.out.println( "1~100사이 숫자를 입력하세요");
	     myNum = sc.nextInt();
	     
	     if(myNum >comNum)
	    	 System.out.println("추측한 값이 큽니다");
	     else if(myNum < comNum)
	    	 System.out.println("추측한 값이 작습니다");
	     else
	    	 System.out.println("빙고 맞췄습니다");
	     }
	     
	     
	     
	}
}
